package com.xbongbong.saas.script.tempenum;

import com.xbongbong.paas.enums.FieldTypeEnum;
import lombok.Getter;

/**
 * DEMO
 *
 * @author GuoJun.HU
 * @since V1.0
 * @date 2019/2/19 10:42
 */
@Getter
public enum DemoIconEnum {
    //
    TEXT("icon-test1",FieldTypeEnum.TEXT.getType()),
    COMB("icon-test8",FieldTypeEnum.COMBO.getType()),
    SUBFORM("icon-test16",FieldTypeEnum.SUB_FORM.getType()),
    DATE("icon-test2",FieldTypeEnum.DATETIME.getType()),
    ADRESS("icon-test12",FieldTypeEnum.ADDRESS.getType())
    ;
    private String icon;
    private Integer filedType;

    DemoIconEnum(String icon, Integer filedType) {
        this.icon = icon;
        this.filedType = filedType;
    }

    public static String getIconStr(Integer filedType){
        for (DemoIconEnum e: values()) {
            if(e.getFiledType().equals(filedType)){
                return e.getIcon();
            }
        }
        return "";
    }
}
